<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var a =1 
 var obj = {
   car1:'a',
   car2:'b',
   car3:'c',

 }
  function which (n) {
     console.log(obj['car'+n]);
   }





  </script>
</body>
</html>